package com.bjpowernode.singleton;

/**
 * @ClassName Singleton07
 *
 * @Author Cat
 */
public final class Singleton07 {

    static {
        System.out.println(1111111111);
    }

    private Singleton07() {

    }

    // 私有静态内部类中创建并初始化实例对象，private私有化，不能被外部调用
    private static class SingletonInner {
        private static Singleton07 instance = new Singleton07();

        static {
            System.out.println(222222222);
        }
    }

    public static Singleton07 getInstance() {
        return SingletonInner.instance;
    }

    public static void main(String[] args) {

    }
}